<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
if ( ! defined( 'NV_SYSTEM' ) ) die( 'Stop!!!' );
if ( ! function_exists( 'nv_block_video' ) ){
    function nv_block_video(){
        global $global_config, $site_mods, $db, $module_name;
        $rVid = 1;
        $get_video_query = "SELECT * FROM `nv_vi_video_picture` WHERE `pictureid`=$rVid";
         if ( ( $query = $db->sql_query( $get_video_query ) ) !== false ){
                if ( ( $row = $db->sql_fetchrow( $query ) ) !== false ){
                    $rs = $row;

                }
        }
         if ( ! empty( $rs['path'] ) and file_exists( NV_UPLOADS_REAL_DIR . "/" . "video" . $rs['path'] ) )
        {
            $rs['path'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" .  "video"  . $rs['path'];
        }
        if ( ! empty( $rs['vpath'] ) and file_exists( NV_UPLOADS_REAL_DIR . "/" .  "video"  . $rs['vpath'] ) )
        {
            $rs['vpath'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" .  "video"  . $rs['vpath'];
        }
        $block_theme = "default";
        $xtpl = new XTemplate( "global.video.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/blocks" );
        $xtpl->assign( 'NV_BASE_SITEURL', NV_BASE_SITEURL );
        $xtpl->assign( 'URL_PP', $rs['path'] );
        $xtpl->assign( 'URL_V', $rs['vpath'] );
        $xtpl->assign( 'VID_NAME', $rs['name'] );
        $xtpl->assign( 'VID_DES', $rs['description'] );
        $xtpl->assign( 'NUM_VVIEW', $rs['num_view'] );
        $xtpl->assign( 'IMGP', NV_BASE_SITEURL . "themes/" . $module_info['template'] . "/images/" . $module_name . "/" );
        $xtpl->parse( 'main' );
        return $xtpl->text( 'main' );
    }
    
}
$content = nv_block_video();
?>
